import Axios from 'axios'

const service = Axios.create({
    baseURL: '', 
    timeout: 5000 
})

service.interceptors.request.use(config => {
    console.log("start axaios----")
    config.url = '/mock' + config.url
    return config
  }, error => {
    // 对请求错误做些什么
    return Promise.reject(error)
  })


  // http response 拦截器
 service.interceptors.response.use(
    response => {
      console.log("返回成功")
      return response.data
    },
    error => {
      // Vue.prototype.$Loading.remove()
      return Promise.reject(error)
  })

export default service
  